#ifndef MYWIDGET_H
#define MYWIDGET_H


#include <QApplication>
#include <QWidget>
#include <QVBoxLayout>
#include <QPushButton>
#include <QPainter>
#include <QPrinter>
#include <QPrintPreviewDialog>

class MyWidget : public QWidget {
    Q_OBJECT
public:
    MyWidget(QWidget *parent = nullptr) ;

protected:
    //void paintEvent(QPaintEvent *event) override;

private slots:
    void onPrintPreview() ;

    void onPaintRequested(QPrinter *printer);
    void myCustomPainting(QPainter *painter);

private:
    void paintContent(QPainter* painter, QPrinter* printer, const QString& strContent, const QString& strTime, qreal& currentY,
        int& pageNumber, const QRectF& pageRect, qreal timeMargin, qreal lineHeight, qreal margin, qreal headerHeight, qreal usableHeight);

    QString strHarwareName;
};



#endif // MYWIDGET_H
